<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        <script>
            //1.第一种方式
            // let game = {
            //     up:() => console.log("我可以上升！"),
            //     down:() => console.log("我可以下降！")
            // };

            // let methods = {
            //     up:Symbol(),
            //     down:Symbol()
            // };

            // game[methods.up] = ()=>console.log("我也可以上升！");
            // game[methods.down] = ()=>console.log("我也可以下降!");
            // console.log(game);

            //2..第二种方式
                let methods = {
                    [Symbol("name")]:"狼人杀",
                    [Symbol("say")]:()=>console.log("我可以说话！")
                };

                console.log(methods);
        </script>
    </body>
</html>